$(function () {
    PetInfo();
})


function PetInfo() {
    $("#petTable").bootstrapTable({
        //请求方式  get请求中文会乱码，建议使用post请求
        method: 'post',
        //请求头部的设置
        contentType: 'application/json',
        //url
        url: '/Dflile.do/pagecx',
        //设置交替行样式
        striped: true,
        //初始显示页号
        pageNumber: 1,
        //设置表格高度
        //height: 350,
        //是否显示分页
        pagination: true,
        //设置是服务端分页还是客户端分页
        sidePagination: 'server',
        //页大小
        pageSize: 3,
        //分页列表
        pageList: [3, 5, 6, 10],
        //上传到服务端的参数
        queryParams:function (params) {
            return{
                num: params.offset / params.limit + 1,
                size: params.limit
            }
        },
        //定义列名
        columns:[
            {title:"产品编号",field:"productid",align:"center",
                formatter:function (vale,row,index) {
                    let d = JSON.stringify(row)
                    return "<a href='#' onclick='XQ("+d+")'>"+vale+"</a>";
                }},
            {title:"产品名称",field:"productname",align:"center"},
            {title:"档次级别",field:"productclass",align:"center",
                formatter:function (vale,row,index) {
                    return vale=='D001-1'?'高档':vale=='D001-2'?'中档':vale=='D001-3'?'低挡':'';
                }},
            {title:"I级分类",field:"firstkindname",align:"center"},
            {title:"II级分类",field:"secondkindname",align:"center"},
            {title:"III级分类",field:"thirdkindname",align:"center"},
            {title:"用途类型",field:"type",align:"center",
                formatter:function (vale,row,index) {
                    return vale=='Y001-1'?'商品':vale=='Y001-2'?'物料':'';
                }
            },
            {title:"产品经理",field:"responsibleperson",align:"center"},
            {title:"状态",field:"checktag",align:"center",
                formatter:function (vale,row,index) {
                    return vale=='S001-0'?'待审核':vale=='S001-1'?'复核通过':vale=='S001-2'?'审核不通过':'';
                }}
        ]
    })
}
function XQ(df) {
    localStorage.setItem("DfileOnt",JSON.stringify(df));
    location.href="../../tan_kai/DflieXQ.html";
}